package commands;

import model.Player;
import controller.HandController;
import controller.handstates.AbstractState;

public abstract class Command {

	protected AbstractState state;
	
	// This is the player who created the cmd. This is used by CommandManager to only run the active players commands.
	protected int seat;
	
	public Command(int seat){
		this.seat = seat;
	}
	
	public boolean execute(AbstractState state){
		this.state = state;
		boolean commandRan = false;
		if(isCmdValid()){
			executeImpl();
			commandRan = true;
		}
		return commandRan;	
			
	}
	
	protected abstract boolean isCmdValid();
	protected abstract void executeImpl();	
	
	public int getPlayerSeat(){
		return seat;
	}
}
